package com.itmayiedu.api.service;

import com.itmayiedu.base.ResponseBase;
import com.itmayiedu.entity.UserEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author cht 【wonderfor@vip.qq.com】
 * @Date 2018/10/19
 */
@RequestMapping("/member")
public interface MemberService {

    @RequestMapping("/findUserById")
    ResponseBase findUserById(Long userId);

    @RequestMapping("/regUser")
    ResponseBase regUser(@RequestBody UserEntity user);

    //用户登录
    @RequestMapping("/login")
    ResponseBase login(@RequestBody UserEntity user);

    /**
     * 使用Token进行登录
     * @param token 用户token值
     * @return
     */
    @RequestMapping("/findByTokenUser")
    ResponseBase findByTokenUser(@RequestParam("token") String token);

    @RequestMapping("/findByOpenIdUser")
    ResponseBase findByOpenIdUser(@RequestParam("openid") String openid);

    //QQ用户登录
    @RequestMapping("/qqLoginOpenId")
    ResponseBase qqLoginOpenId(@RequestBody UserEntity user);

}
